const routes = [
  {
    path: "/",
    name: "login",
    component: () => import("@/page/login/login.vue"),
  },
  {
    path: "/index",
    name: "index",
    component: () => import("@/page/index/index.vue"),
    redirect: "data-analysis",
    children: [
      {
        //经营分析
        path: "/data-analysis",
        name: "data-analysis",
        component: () => import("@/page/data-analysis/index.vue"),
        meta: {
          title: "经营分析",
          id: "1",
        },
      },
      {
        //订单管理
        path: "/order-management",
        name: "order-management",
        component: () => import("@/page/order-management/index.vue"),
        meta: {
          title: "订单管理",
          id: "2",
        },
      },
      {
        //商品管理
        path: "/dish-list",
        name: "dish-list",
        component: () => import("@/page/dish-list/index.vue"),
        meta: {
          title: "商品管理",
          id: "3",
        },
      },
      {
        //发布商品
        path: "/add-product",
        name: "add-product",
        component: () => import("@/page/add-product/index.vue"),
        meta: {
          title: "新建商品",
          id: "3",
        },
      },
      {
        //堂食点餐
        path: "/order-desk",
        name: "/order-desk",
        component: () => import("@/page/order-desk/index.vue"),
        meta: {
          title: "堂食点餐",
          id: "4",
        },
      },
      {
        //员工管理
        path: "/staff-management",
        name: "staff-management",
        component: () => import("@/page/staff-management/index.vue"),
        meta: {
          title: "员工管理",
          id: "5",
        },
      },
    ],
  },
];


// 创建路由实例
import { createRouter, createWebHashHistory } from "vue-router";
const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
